1 00:00:01,520 --> 00:00:02,260 Hi there. 2 00:00:02,270 --> 00:00:05,270 I have a proposed activity I'd like for you to solve. 3 00:00:05,480 --> 00:00:07,400 The activity goes as this. 4 00:00:07,520 --> 00:00:10,790 I want you to create a function that has two string parameters. 5 00:00:10,790 --> 00:00:12,500 The strings can be whatever. 6 00:00:12,800 --> 00:00:17,270 With those two strings, I want you to print both together with a space separating them. 7 00:00:17,450 --> 00:00:22,310 Then have the function yield for 0.5 seconds afterwards. 8 00:00:22,310 --> 00:00:29,300 Print the two strings together, but have both reversed yield again for another 0.5 seconds and then 9 00:00:29,300 --> 00:00:35,240 finally print the two strings together, but have both capitalized after that print finished. 10 00:00:35,750 --> 00:00:39,320 Then I want you to call this function ten times using a for loop. 11 00:00:39,740 --> 00:00:44,720 So please take a minute or two to solve this activity and I'll show you my solution next. 12 00:00:47,670 --> 00:00:48,300 Okay. 13 00:00:48,300 --> 00:00:53,400 Our first understand that I need to create a function and that function needs to parameters. 14 00:00:53,700 --> 00:00:55,770 So I'll create a new function here. 15 00:00:55,830 --> 00:00:59,910 I'll call mine, handle strings and declare two parameters. 16 00:00:59,910 --> 00:01:01,560 String one and string two. 17 00:01:02,520 --> 00:01:06,140 Since both need to be strings, I'll declare the type as well. 18 00:01:06,150 --> 00:01:07,470 But you don't have to. 19 00:01:11,000 --> 00:01:12,710 Next operant string one. 20 00:01:14,130 --> 00:01:16,110 Then concatenate it with the space. 21 00:01:16,840 --> 00:01:19,450 And then concatenate the space with string to. 22 00:01:20,430 --> 00:01:21,060 Afterwards. 23 00:01:21,060 --> 00:01:26,730 I need a yield for 0.5 seconds, so I'll call the task weight function and past 0.5 is the argument. 24 00:01:27,750 --> 00:01:29,490 Then I can call the print function again. 25 00:01:29,490 --> 00:01:32,030 But this time the strings need to be reversed. 26 00:01:32,040 --> 00:01:38,520 So I'll call the string reverse function inside the print function and pass string one concatenate it 27 00:01:38,520 --> 00:01:41,730 with the space and then concatenate it with string to. 28 00:01:43,410 --> 00:01:45,780 Then I will yield 4.5 seconds again. 29 00:01:46,230 --> 00:01:48,270 Now all I need to do is print these uppercase. 30 00:01:48,270 --> 00:01:54,720 So once more I call the print function and inside call the string upper function and pass string one. 31 00:01:55,480 --> 00:01:59,590 Concatenate it with the space and then concatenate it with string to. 32 00:02:00,530 --> 00:02:01,940 Now I can print finished. 33 00:02:04,060 --> 00:02:04,530 Great. 34 00:02:04,540 --> 00:02:06,250 Let's create a for loop next. 35 00:02:06,580 --> 00:02:12,610 I'll set eye to one the max number for I will be ten and I'll increment by one each time to execute 36 00:02:12,610 --> 00:02:13,540 ten times. 37 00:02:14,690 --> 00:02:19,730 Let's call this function in my loop and I'll pass to random strings like, Hey there. 38 00:02:20,580 --> 00:02:21,420 And howdy. 39 00:02:22,680 --> 00:02:24,480 Run the game and see what happens. 40 00:02:27,290 --> 00:02:27,770 Awesome. 41 00:02:27,800 --> 00:02:29,000 Our function works.